'use strict';

var Router = require('koa-router'),
 config = require('../../config/config'),
 ctrl = require('./user.controller');

var userRouter = function userRouter(app) {
  var router = new Router({
    prefix: config.routerPrefix.v1.authorizations
  });

  app
    .use(router.routes())
    .use(router.allowedMethods());

  router.post('/', ctrl.createAuthorization)
    .delete('/:id', ctrl.deleteAuthorization)
    .put('/:id', ctrl.createAuthByKey)
    ;

};

module.exports = userRouter;
